<admintpl file="header" />
</head>
<body>
	<div class="wrap">
		<ul class="nav nav-tabs">
			<if condition="(I('request.disp') eq 'M1')">
				<li><a href="{:U('Examine/loan_overdue_user_m1')}">逾期M1列表</a></li>
			<elseif condition="(I('request.disp') eq 'M2')"/>
				<li><a href="{:U('Examine/loan_overdue_user_m2')}">逾期M2列表</a></li>
			<else />
				<li><a href="{:U('Examine/loan_overdue')}">逾期列表</a></li>
			</if>
			<li  class="active"><a>我的客户</a></li>
		</ul>
		<form class="well form-search" method="post" action="">
			手机号码： 
			<input type="text" name="mobile" style="width: 200px;" value="{:I('request.mobile')}" placeholder="请输入手机号码">
			姓名： 
			<input type="text" name="name" style="width: 200px;" value="{:I('request.name')}" placeholder="姓名">
			逾期时间：<input class="js-date" type="text" name="starts" style="width: 200px;" value="{:I('request.starts')}" placeholder="起始时间">
			<input class="js-date" type="text" name="ends" style="width: 200px;" value="{:I('request.ends')}" placeholder="结束时间">
			<br/>
			借款状态：
			<select name="status">
				<php>$tpl_selected=I('request.status')=='0'?"selected":"";</php>
				<option {$tpl_selected} value="0">全部(不包含审核不通过和待审核)</option>
				<php>$tpl_selected=I('request.status')=='1'?"selected":"";</php>
				<option {$tpl_selected} value="1">借款中</option>
				<php>$tpl_selected=I('request.status')=='2'?"selected":"";</php>
				<option {$tpl_selected} value="2">已还款</option>
				<php>$tpl_selected=I('request.status')=='3'?"selected":"";</php>
				<php>$tpl_selected=I('request.status')==''?"selected":$tpl_selected;</php>
				<option {$tpl_selected} value="3">逾期</option>
				<php>$tpl_selected=I('request.status')=='4'?"selected":"";</php>
				<option {$tpl_selected} value="4">到期</option>
				<php>$tpl_selected=I('request.status')=='8'?"selected":"";</php>
				<option {$tpl_selected} value="8">放款成功</option>
			</select>
			&nbsp;查看下属：
			<select name="dh_level">
				<option value="">自己</option>
				<eq name="is_has_tree" value="1">
					<option value="a">全部包括自己</option>
					<option value="b">全部不包括自己</option>
					{$tree}
				</eq>
			</select>
			<script>
				$('select[name="dh_level"]').find('option[value="{:I(\'request.dh_level\')}"]').prop('selected',true);
			</script>

			<input type="submit" class="btn btn-primary" value="搜索" />
			<a class="btn btn-danger" href="">清空</a>
		</form>
		<form method="post" class="js-ajax-form">
			<table class="table table-hover table-bordered">
				<thead>
					<tr>
						<th  align="center">{:L('NUMBERS')}</th>
						<th>{:L('MOBILE')}</th>
						<th>{:L('USERS_NAME')}</th>
						<th>身份证号码</th>
						<th>{:L('AMOUNT')}</th>
						<th>{:L('EXAM_WEEK')}</th>
						<th>{:L('STAGES')}</th>
						<th>还款时间</th>
						<th>{:L('USER_TYPE')}</th>
						<th>{:L('EXAM_TYPE')}</th>
						<th>负责专员</th>
						<th align="center">{:L('ACTIONS')}</th>
					</tr>
				</thead>
				<tbody>
					<foreach name="list" item="vo">
					<tr>
						<td align="center">{$vo.order_id}</td>
						<td>{$vo.mobile}</td>
						<td><a href="{:U('Examine/overdue_info',array('id'=>$vo['id']))}" >{$vo.name}</a></td>
						<td>{$vo.identity}</td>
						<td>{$vo.amount}</td>
						<td>{$vo.loan_day}天</td>
						<td align="center">{$vo.stages}</td>
						<td>{$vo.sub_endtime}</td>
						<php>$ds=array('0'=>'<span style="color:red">未认证</span>','1'=>'<span style="color:green">已认证</span>','2'=>'<span style="color:red">认证未通过</span>','3'=>'<span style="color:red">暂时不需要</span>')</php>
						<td>{$ds[$vo['account_status']]}</td>
						<td><if condition="($vo.status eq 0)">待审核
							<elseif condition="$vo.status eq 1"/>借款中
							<elseif condition="$vo.status eq 2"/>已还款
							<elseif condition="$vo.status eq 3"/>逾期
							<elseif condition="$vo.status eq 4"/>已到期
							<elseif condition="$vo.status eq 5"/>审核中
							<elseif condition="$vo.status eq 6"/>审核不通过
							<elseif condition="$vo.status eq 7"/>驳回
							<elseif condition="$vo.status eq 8"/>放款成功
							<elseif condition="$vo.status eq 9"/>放款不成功
							<elseif condition="$vo.status eq 10"/>待放款
							</if></td>
						
						<if condition="(I('request.disp') eq 'M1')">
							<td>{$users[$vo['byusers_loan_m1']]}</td>
						<elseif condition="(I('request.disp') eq 'M2')"/>
							<td>{$users[$vo['byusers_loan_m2']]}</td>
						<elseif condition="(I('request.disp') eq 'M3')"/>
							<td>{$users[$vo['byusers_loan_m3']]}</td>
						<else />
							<td>{$users[$vo['byusers_loan']]}</td>
						</if>
						<td align="center">
							<if condition="$vo.status eq 3">
								<a href="{:U('Examine/overdue_exam',array('id'=>$vo['id']))}" >逾期还款审核</a>
								<br/>|<a href="{:U('Examine/after_collection',array('id'=>$vo['id']))}">催收后记</a>
							</if>
						</td>
					</tr>
					</foreach>
				</tbody>
				<tfoot>
				<tr>
					<td>当页合计：</td>
					<td></td>
					<td></td>
					<td></td>
					<td></td>
					<td></td>
					<td></td>
					<td></td>
					<td></td>
					<td></td>
					<td></td>
					<td></td>
				</tr>
				<tr>
					<td>总计：</td>
					<td></td>
					<td></td>
					<td></td>
					<td>{$total_amount}</td>
					<td></td>
					<td></td>
					<td></td>
					<td></td>
					<td></td>
					<td></td>
					<td></td>
				</tr>
				</tfoot>
			</table>
			<div class="pagination">{$page}</div>
		</form>
	</div>
	<script src="__PUBLIC__/js/common.js"></script>
	<script>
        $(function () {
            var arr = [4];//要取哪几列的合计
            var def = 'var ';
            for(var a in arr){
                def += ('total'+arr[a]+'=0,');
            }
            def=def.substring(0,def.length-1)+';';
            eval(def);//执行定义
            $('tbody tr').each(function() {
                for(var i in arr){
                    $(this).find('td:eq('+arr[i]+')').each(function(){
                        var tmp = $(this).text();
                        if(tmp === ''){
                            tmp = 0;
                        }
                        eval('total'+arr[i]+'+=parseFloat(tmp);');
                    });
                }
            });
            for(var x in arr){
                $('tfoot tr:eq(0)').find('td:eq('+arr[x]+')').text(eval('total'+arr[x]));
            }
        });
	</script>
</body>
</html>